package com.pokeoffice.tests;

import java.sql.Connection;
import java.sql.SQLException;

import com.pokeoffice.database.Control;
import com.pokeoffice.users.Admin;
import com.pokeoffice.users.User;
import com.pokeoffice.users.UserType;

/**
 * The Class MyStuff.
 */
public class MyStuff {

	/**
	 * The main method.
	 *
	 * @param args the arguments
	 */
	public static void main(String[] args) {
		createMe();
	}
	
	/**
	 * Creates the me.
	 */
	public static void createMe() {
		User me = new Admin();
		
		me.setUserType(UserType.ADMIN);
		me.setName("Kyle");
		me.setBirthdate("1991-11-21");	
		me.setGender("M");
		me.setPhone("7701234567");
		me.setCity("Woodstock");
		me.setRegion("South East");
		me.setPharmacy("Pharmacy");
		me.setInsurance("Woodstock Insurance Inc.");
		
		Control ctrl = Control.get();
		Connection con = ctrl.connect("root", "root");
		
		try {
			ctrl.createUser(con, me);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		try {
			con.commit();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	
}
